package com.kirk.cts.core.constants;

/**
 * <p> SystemConstants.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-08-29 22:21
 * @Description 系统常量
 */
public class SystemConstants {


    /**
     * 窗体默认宽度
     */
    public static final int FRAME_DEFAULT_WIDTH = 1280;
    /**
     * 窗体默认高度
     */
    public static final int FRAME_DEFAULT_HEIGHT = 768;

    /**
     * 帮助窗体默认宽度
     */
    public static final int HELP_FRAME_DEFAULT_WIDTH = 600;
    /**
     * 帮助窗体默认高度
     */
    public static final int HELP_FRAME_DEFAULT_HEIGHT = 415;


    // 获取系统路径
    public static final String SYSTEM_ROOT_PATH = System.getProperties().getProperty("user.dir") + "\\crawlers";

    // 系统文件路径分隔符
    public static final String SYSTEM_SEPARATOR = System.getProperties().getProperty("file.separator");

    // 文件协议
    public static final String PROTOCOL_FILE = "file:";

    // 网路协议
    public static final String HTTP = "http://";
    public static final String HTTPS = "https://";

    // plugin配置文件参数名
    public static final String PLUGIN_PROPERTIES_KY_PATH = "path";
    public static final String PLUGIN_PROPERTIES_KY_ID = "Id";
    public static final String PLUGIN_PROPERTIES_KY_NAME = "Name";
    public static final String PLUGIN_PROPERTIES_KY_VERSION = "Version";
    public static final String PLUGIN_PROPERTIES_KY_PROVIDER = "Provider";
    public static final String PLUGIN_PROPERTIES_KY_BEANXMLPATH = "BeanXmlPath";
    public static final String PLUGIN_PROPERTIES_KY_REQUIRES = "Requires";
    public static final String PLUGIN_PROPERTIES_KY_ACTIVE = "Active";
    public static final String PLUGIN_PROPERTIES_KY_LOGOIMAGEPATH = "LogoImagePath";

    // 状态码
    public static final String YES = "true";
    public static final String NO = "false";
    public static final String SCAN = "scan";

    public static final String TASK_STATUS_STOP = "stop";// 停止

    public static final String TASK_STATUS_RUN = "run";// 执行中

    public static final String TASK_STATUS_PAUSE = "pause";// 暂停

    public static final String TASK_STATUS_COMPLETE = "complete";// 完成

    public static final String ACTION_LISTENER = "actionListener";

    public static final String OPTION_TYPE_ADD = "ADD";

    public static final String OPTION_TYPE_SAVEAS = "SAVEAS";

    public static final String OPTION_TYPE_MODIFY = "MODIFY";

    public static final String OPTION_TYPE_EXECUTE = "EXECUTE";

    public static final int PAGE_LIMIT = 20;// 每页显示记录条数


    /**
     * 国际化配置路径
     */
    public static final String PACKAGE_I18N = "settings" + getDot() + "i18n";
    /**
     * 国际化配置名称
     */
    public static final String I18N_BUNDLE_NAME = PACKAGE_I18N + getDot() + "CrawlerToolAppLocal";

    /**
     * 系统图标配置路径
     */
    public static final String PACKAGE_IMAGE_PATH = "settings" + getDot() + "image";

    /**
     * 系统图标配置名称
     */
    public static final String IMAGE_BUNDLE_NAME = PACKAGE_IMAGE_PATH + getDot() + "CrawlerToolAppResources";

    /**
     * 系统异常信息配置路径
     */
    public static final String PACKAGE_EXCEPTION_PATH = "settings" + getDot() + "exception";
    /**
     * 系统异常信息配置名称
     */
    public static final String EXCEPTION_BUNDLE_NAME = PACKAGE_EXCEPTION_PATH + getDot() + "CrawlerToolAppException";


    /**
     * 图片相关资源定义
     */

    // 资源图片存放包名
    public static final String PACKAGE_IMAGE = "images";

    // 资源图标存放包名
    public static final String PACKAGE_ICONS = "icons";

    // 图标资源存放相对路径
    public static final String PACKAGE_IMAGE_ICONS = PACKAGE_IMAGE + SYSTEM_SEPARATOR + PACKAGE_ICONS;


    public static String getDot() {
        return ".";
    }
}
